package com.softteem.music_sys.controller;

import com.softteem.music_sys.entity.Admin;
import com.softteem.music_sys.mapper.AdminMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AdminController {

    @Autowired
    private AdminMapper adminMapper;


    @RequestMapping( "/admin/add")
    public boolean add(String username, String password) {
        Admin admin = new Admin();
        admin.setUsername(username);
        admin.setPassword(password);
        int i = adminMapper.insert(admin);
        return i > 0;

    }

    public boolean login(String username, String password) {


    }
}
